import 'package:flutter/material.dart';
import 'package:mall/constant/app_colors.dart';
import 'package:mall/constant/app_strings.dart';

class GoodsPriceWidget extends StatelessWidget {
  const GoodsPriceWidget({
    super.key,
    this.price = 0,
    this.priceFontSize = 26,
    this.priceColor = AppColors.C_EC2010,
  });

  final double? price;
  final double priceFontSize;
  final Color priceColor;

  @override
  Widget build(BuildContext context) {
    return Text.rich(
      TextSpan(
        text: '￥',
        style: TextStyle(
          fontSize: 17 / 26 * priceFontSize,
          fontWeight: FontWeight.bold,
          color: priceColor,
        ),
        children: [
          TextSpan(
            text: '$price',
            style: TextStyle(
              fontSize: priceFontSize,
              fontWeight: FontWeight.bold,
              color: priceColor,
            ),
          ),
        ],
      ),
    );
  }
}
